<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>up7-AWS-S3-演示页面</title>
    <link rel="stylesheet" type="text/css" href="/static/up7/panel/up7.css" />
    <script type="text/javascript" src="/static/jquery-1.4.min.js"></script>
    <script type="text/javascript" src="/static/json2.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/up7/panel/up7.file.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/up7/panel/up7.folder.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/up7/up7.edge.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/up7/up7.app.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/up7/panel/up7.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/demo.js" charset="utf-8"></script>
    <script language="javascript" type="text/javascript">
        //根路径：http://localhost/api/up6/
        var pos = window.location.href.lastIndexOf("cloud/");
        var api = [
            window.location.href.substr(0, pos),
            "/"
        ].join("");

        var cbMgr = new HttpUploaderMgr({
            Config: {
                License2: "",//授权码
                FileFilter: "*",//限制上传的文件类型
                security: {
                    //需要在config.json/security.encrypt中同时开启传输加密
                    encrypt: false
                },
                storage: {
                    type: "s3",
                    s3: {
                        "ak": "DFcO/GPGKX9y2GbW5fgHEHFIR8JLYzMonDowrDV0MHg=",
                        "sk": "cA8f3U3u/OIdhoP9h7z2N+Vje4suHBmEPho39sF2YJRznobPOKwdeifB5H6aFsQC",
                        "service": "s3",
                        "bucket": "up7-s3",
                        "region": "cn-north-1",
                        "endpoint": "https://up7-s3.s3.cn-north-1.amazonaws.com.cn"
                    }
                },
                //赋加字段，业务逻辑字段
                Fields: { uid: "0" },
                //后端接口-文件夹
                "UrlFdCreate": api+"fd_create",
                "UrlFdComplete": api+"fd_complete",
                "UrlFdDel": api+"fd_del",
                //后端接口-文件
                "UrlCreate": api+"f_create",
                "UrlPost": api+"f_post",
                "UrlNotice": api+"f_notice",
                "UrlUpdate": api+"f_update",
                "UrlComplete": api+"f_complete",
                "UrlList": api+"f_list",
                "UrlDel": api+"f_del"
            },//事件
            event: {
                md5Complete: function (obj, md5) {
                    //文件md5计算完毕
                },
                fileAppend: function (f) {
                    //添加自定义参数
                    //$.extend(true, o.fields, {uname:"a",upass:"b"});
                },
                fileComplete: function (obj) {
                    //文件上传完毕
                },
                queueComplete: function () {
                    //队列中所有文件上传完毕
                    $(document.body).append("队列完成<br/>");
                },
                addFdError: function (jv) {
                    //添加文件夹错误
                    alert("本地路径不存在：" + jv.path);
                },
                scanComplete: function (obj) {
                    //目录扫描完毕
                },
                loadComplete: function (m) {
                    //控件加载完毕
                }
            },
            ui: {
                render: "FilePanel"
            }
        });
    </script>
    <style type="text/css">
        h4 {margin:0;}
        p {font: 9pt 宋体;}
        ul {list-style-type: none;font: 9pt 宋体;}
        ul li {display: inline;margin: 0 5px 0 0;font: 9pt 宋体;}
    </style>
</head>
<body>
<h4>up7-AWS-S3-演示页面</h4>
<p>文件以直传方式上传到S3中，不经过服务器中转，同时支持AWS国际站，AWS国内站</p>
<p>注意：AK,SK信息需要加密，加密工具：<a href="http://www.ncmem.com/webapp/up7/encrypt.aspx" target="_blank">http://www.ncmem.com/webapp/up7/encrypt.aspx</a></p>
<div id="demos"></div>
<!--ui-->
<div id="FilePanel"></div>
<div id="msg"></div>
</body>
</html>